/**
  ****************************(C) COPYRIGHT 2019 DJI****************************
  * @file       param_H
  * @brief      参数设置文件
  * @note
  * @history

  *
  @verbatim
  ==============================================================================

  ==============================================================================
  @endverbatim
  ****************************(C) COPYRIGHT 2019 DJI****************************
  */
#ifndef param_H
#define param_H
#include "struct_typedef.h"

#define Kt 0.18f          /*Nm*A*/
#define DIAMETER 0.102F   /*轮子直径*/
#define DIAMETER_r 0.051f /*轮子半径*/
#define Motor_n_1 36.0f   /*减速比*/
#define ecd_Max 8192.0f

#define Nm2motor 10000.0f / (10.0f * 0.18f) /*转矩命令->电机电流命令*/
#define motor2Nm 10.0f * 0.18f / 10000.0f   /*电机电流命令->转矩命令*/

#define rpm2rad PI / 30.0f /*内转子速度rpm->rad/s*/
#define rad2rpm 30.0f / PI

#define m_s2rpm 30.0f * Motor_n_1 / PI / DIAMETER_r     /*m/s to rpm*/
#define rpm2m_s (PI * DIAMETER_r) / (30.0f * Motor_n_1) /*m/s to rpm*/

#define m2ecd ecd_Max *Motor_n_1 / (2.0f * PI * DIAMETER_r)    /*m to encode*/
#define ecd2m (2.0f * PI * DIAMETER_r) / (ecd_Max * Motor_n_1) /*encode to m*/

#define N2Nm 1.0f / DIAMETER_r / Motor_n_1 /*N to N*m*/

#define ecd2rad 2.0F * PI / (ecd_Max * Motor_n_1) /*encode2rad*/

#define Max_motor_current 10000.0f                                         /*电调最大输出电流值*/
#define Max_speed_MOTOR 1800.0f * rad2rpm                                  /*内转子电机最大转速：RPM*/
#define Max_speed_MOTOR_rad 1800.0f                                        /*内转子电机最大转速：rad/s*/
#define Max_angle_err Max_speed_MOTOR *rpm2rad * 0.001f * ecd_Max / 2 / PI // 2346.8
#define Max_speed_CAR 2.0f                                                 /*小车最大车速：M/s*/

/*

*/

#endif
